//
//  ViewController.m
//  Share
//
//  Created by lanou3g on 16/4/8.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "ViewController.h"
#import <ShareSDK/ShareSDK.h>
#import <ShareSDKUI/ShareSDK+SSUI.h>

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

//点击分享按钮
- (IBAction)didClickShareButton:(UIButton *)sender {
    //构造分享内容
    UIImage *image = [UIImage imageNamed:@"30.jpg"];
    NSArray *imgArray = [NSArray arrayWithObject:image];
    //参数字典
    NSMutableDictionary *params = [NSMutableDictionary new];
    //
    [params SSDKSetupShareParamsByText:@"我要分享的内容,比如:XXX太好玩了!" images:imgArray url:[NSURL URLWithString:@"http://www.maincode.cn"] title:@"来自XX的分享" type:SSDKContentTypeAuto];
    
    [ShareSDK showShareActionSheet:nil items:nil shareParams:params onShareStateChanged:^(SSDKResponseState state, SSDKPlatformType platformType, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error, BOOL end) {
        
        switch (state) {
            case SSDKResponseStateSuccess:
                NSLog(@"分享成功");
                break;
                
            default:
                break;
        }
    }];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
